//
//  YMCubicCurve.m
//  bezierPath
//
//  Created by Andrew on 2018/7/25.
//  Copyright © 2018年 Andrew. All rights reserved.
//  三次曲线

#import "YMCubicCurve.h"

@implementation YMCubicCurve

- (void)drawRect:(CGRect)rect
{
    //三次曲线
    UIBezierPath *bPath = [UIBezierPath bezierPath];
    bPath.lineWidth = 5.0;
    //线条拐角
    bPath.lineCapStyle = kCGLineCapRound;
    //终点处理
    bPath.lineJoinStyle = kCGLineCapRound;
    //起始点
    [bPath moveToPoint:CGPointMake(20, 250)];
    
    //添加两个控制点
    [bPath addCurveToPoint:CGPointMake(350, 250) controlPoint1:CGPointMake(310, 200) controlPoint2:CGPointMake(210, 400)];
    [bPath stroke];
}


@end
